package com.springboot.service;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author yexi
 */
@Service
@Cacheable(cacheNames = "articles")
public class ArticleService {

    public String getArticle() {
        System.out.println("getArticle()方法被调用，通过从数据库或者其他数据源查询文章数据并返回");
        return "查询到的文章信息";
    }

    public String getArticleByUserId(Long userId) {
        System.out.println("getArticleByUserId()方法被调用，传入参数为: " + userId);
        return "查询到的文章信息";
    }

}
